/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.support;

import ru.jSkyRoom.interfaces.major.Major;
import ru.jSkyRoom.interfaces.support.NullArgumentPermitted;
import skyproc.FormID;

/**
 *
 * @author Rakev
 */
public class FormIdProducer {

    private static FormIdProducer instance = new FormIdProducer();

    public static FormIdProducer create() {
        return instance;
    }

    protected FormIdProducer() {
    }

    @NullArgumentPermitted
    public <F extends Major> FormID produce(F fromObject) {
        if (fromObject != null) {
            return fromObject.getForm();
        } else {
            return null;
        }
    }
}
